// vite.config.js
import { defineConfig, loadEnv } from "file:///D:/tj/saiadmin-vue/node_modules/vite/dist/node/index.js";
import vue from "file:///D:/tj/saiadmin-vue/node_modules/@vitejs/plugin-vue/dist/index.mjs";
import { resolve } from "path";
import vueJsx from "file:///D:/tj/saiadmin-vue/node_modules/@vitejs/plugin-vue-jsx/dist/index.mjs";
import { visualizer } from "file:///D:/tj/saiadmin-vue/node_modules/rollup-plugin-visualizer/dist/plugin/index.js";
var __vite_injected_original_dirname = "D:\\tj\\saiadmin-vue";
var vite_config_default = ({ mode }) => {
  const env = loadEnv(mode, process.cwd());
  const proxyPrefix = env.VITE_APP_PROXY_PREFIX;
  return defineConfig({
    base: env.VITE_APP_BASE,
    plugins: [
      vue(),
      vueJsx(),
      visualizer({
        emitFile: false,
        file: "stats.html",
        //分析图生成的文件名
        open: true
        //如果存在本地服务端口，将在打包后自动展示
      })
    ],
    resolve: {
      alias: {
        "@": resolve(__vite_injected_original_dirname, "src"),
        "@cps": resolve(__vite_injected_original_dirname, "src/components"),
        "vue-i18n": "vue-i18n/dist/vue-i18n.cjs.js"
      }
    },
    build: {
      chunkSizeWarningLimit: 1500
      // rollupOptions: {
      //   output: {
      //     manualChunks(id) {
      //       if (id.includes('node_modules')) {
      //         return id.toString().split("node_modules/")[1].split("/")[0].toString();
      //       }
      //     }
      //   }
      // }
    },
    server: {
      host: "0.0.0.0",
      port: env.VITE_APP_PORT || process.env.port,
      proxy: {
        [proxyPrefix]: {
          target: env.VITE_APP_BASE_URL,
          changeOrigin: true,
          ws: true,
          toProxy: true,
          rewrite: (path) => path.replace(new RegExp(`^${proxyPrefix}`), "")
        }
      }
    }
  });
};
export {
  vite_config_default as default
};
//# sourceMappingURL=data:application/json;base64,ewogICJ2ZXJzaW9uIjogMywKICAic291cmNlcyI6IFsidml0ZS5jb25maWcuanMiXSwKICAic291cmNlc0NvbnRlbnQiOiBbImNvbnN0IF9fdml0ZV9pbmplY3RlZF9vcmlnaW5hbF9kaXJuYW1lID0gX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